package com.xps.charmingshop;

import android.app.Application;
import android.os.Build;
import android.support.annotation.RequiresApi;

import com.jude.utils.JUtils;
import com.squareup.leakcanary.LeakCanary;
import com.xps.charmingshop.utils.SharedPreferencesUtils;


@RequiresApi(api = Build.VERSION_CODES.CUPCAKE)
public class App extends Application {
    private static App INSTANCE;

    @Override
    public void onCreate() {
        super.onCreate();
        INSTANCE = this;
        //初始化本地字段存储
        SharedPreferencesUtils.init(this);
        //检测内存泄露
        if (LeakCanary.isInAnalyzerProcess(this)) {
            return;
        }
        LeakCanary.install(this);
//        Jutlis工具类初始话
        JUtils.initialize(this);

    }

    public static App getInstance() {
        return INSTANCE;
    }
}
